﻿namespace wToggle.Platform.Data
{
    using System.Collections.Generic;
    using System.Runtime.Serialization;

    [DataContract]
    public class ReportResponse<TData>
    {
        [DataMember(Name = "total_grand")]
        public ulong? TotalMiliseconds { get; set; }

        [DataMember(Name = "total_billable")]
        public ulong? TotalBillable { get; set; }

        [DataMember(Name = "total_currencies")]
        public List<CurrencyTotal> TotalCurrencies { get; set; }

        [DataMember(Name = "data")]
        public List<TData> Data { get; set; }
    }

    [DataContract]
    public sealed class DetailReportResponse : ReportResponse<ReportTimeEntry>
    {
        [DataMember(Name = "total_count")]
        public uint TotalCount { get; set; }

        [DataMember(Name = "per_page")]
        public uint PageSize { get; set; }
    }

    [DataContract]
    public sealed class CurrencyTotal
    {
        [DataMember(Name = "currency")]
        public string Currency { get; set; }

        [DataMember(Name = "amount")]
        public double Amount { get; set; }
    }
}
